package cn.glinks.liuhe.baserx;

import java.io.Serializable;

/**
 * Des:封装服务器返回数据
 *
 * @author MarsBlade of Cyh
 * @created 2017-03-13 18:37
 */
public class BaseResponse<T> implements Serializable {
    public int status;
    public String msg;
    public T data;

    public boolean isSuccess() {
        return status == 0;
    }

    public boolean isFailed() {
        return status < 0;
    }

    @Override
    public String toString() {
        return "BaseResponse = {\n\r" +
                "status=" + status + "\n\r" +
                "msg=\"" + msg + "\"\n\r" +
                "data=" + data + "\n\r" +
                '}';
    }
}
